<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2522：[Shoi2010]团队游戏</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Shoi2010]团队游戏</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Shoi2010]团队游戏</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Shoi2010]团队游戏                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%"><span style="font-size: medium">自从NOI的比赛加入了团体赛，SHOI的领队就发现培养学生之间的团队协作精神是十分重要的。所以，今年SHOI的领队就决定，在上海代表队选拔赛结束后，组织大家在大草坪上做一个团队游戏，培养选手之间的默契、协作。</span></div>
<div style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%"><span style="font-size: medium">现在Secsa&ldquo;偷偷&rdquo;地把这个小游戏的内容告诉你，也许你到时候可以赢得小游戏的冠军，获得一份特别的小礼品哦！</span></div>
<div style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%"><span style="font-size: medium">这是一个每两人为一队的、需要双人配合的游戏。游戏中会有一根绳子系在作为队友的两人身上，也就是说在整个游戏过程中，两人之间的距离不能超过这根绳子的长度。</span></div>
<p></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">游戏开始之前，大草坪上画上了一个简单多边形（边界不自交，但既可能是凸的也可能是凹的）。</span></font></span><font size="3"><font face="宋体"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;"><o:p></o:p></span></font></font></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">同一队的两人可以自由的在多边形上选一点一同出发，但出发时他们是背对背的。整个游戏的过程中两人可以沿着多边形的边界向前走或者向后退，如果他们两人能够最终面对面地相遇，那么他们就胜利了。整个游戏过程中，反转方向是不允许的</font></span></span><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftn1" name="_ftnref1"></a><span style="font-size: medium"><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftn1" name="_ftnref1"><span class="MsoFootnoteReference"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;"><span style="mso-special-character: footnote"><span class="MsoFootnoteReference"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">[1]</span></span></span></span></span></a><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">。如</span>图 <span lang="EN-US" style="mso-no-proof: yes">5</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">中所示，只要系在两人身上的绳子的长度不少于</span></font><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;">W</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">，那么两人就可以沿箭头方向朝前走，并最终胜利。</span></font></span></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><img alt="" src="../file/2522_0.jpg" /></span></font></span></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">显然，系在队友身上的绳子越短，想要获胜的难度越高。所以，你现在的任务就是根据草坪上画的多边形的形状计算出：能够完成游戏并胜利的最短的绳子的长度。</span></font></span><font size="3"><font face="宋体"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;"><o:p></o:p></span></font></font></p>
<div style="mso-element: footnote-list">
<p></p>
<p></p>
<p><span style="font-size: medium"><br clear="all" />
</span><font face="宋体" size="3"><hr width="33%" align="left" size="1" />
</font></p>
<div id="ftn1" style="mso-element: footnote">
<p class="MsoFootnoteText" style="margin: 0cm 0cm 0pt"><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftnref1" name="_ftn1"></a><span style="font-size: medium"><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftnref1" name="_ftn1"><span class="MsoFootnoteReference"><span lang="EN-US"><span style="mso-special-character: footnote"><span class="MsoFootnoteReference"><span lang="EN-US" style="font-family: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">[1]</span></span></span></span></span></a><span lang="EN-US"><font face="Times New Roman"> </font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于每一个简单多边形而言，都有两种方式可以沿着其边缘环绕一周，这两种环绕方式的方向是相反的，我们称其中一种为正方向，另一种为负方向。例如，就一个凸多边形而言，有顺时针和逆时针两种方向相反的环绕方法。这里所说的&ldquo;反转方向是不允许的&rdquo;是指：在整个游戏的过程中，作为队友的</span><span lang="EN-US"><font face="Times New Roman">AB</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">两人，</span><span lang="EN-US"><font face="Times New Roman">A</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必须始终面朝着正方向，</span><span lang="EN-US"><font face="Times New Roman">B</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必须始终朝着负方向，但</span><span lang="EN-US"><font face="Times New Roman">AB</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">两人在任意时刻都可以前进或者后退，或者其中一人前进另一人后退。</span></span></p>
</div>
</div></p><hr/><h3>输入格式</h3><p><p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><font size="3"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">输入文件的第一行有两个正整数</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">n</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">，表示多边形的边数。接下来</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">n</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">行，每行有两个整数</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">x</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">、</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">y</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">，依次描述多边形的顶点的坐标。</span><span lang="EN-US" style="font-family: 'Times New Roman'"><o:p></o:p></span></font></font></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><font size="3"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">输入文件保证：这些点坐标的绝对值都不超过</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">100</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">。</span><span lang="EN-US" style="font-family: 'Times New Roman'"><o:p></o:p></span></font></font></p></p><hr/><h3>输出格式</h3><p><p class="MsoNormal" style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang="EN-US" style="font-size: 12pt"><o:p></o:p></span></b>&nbsp;</p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><font size="3"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">输出文件只有一行，这行只有一个实数，即为能够完成游戏的最短的绳子的长度，保留</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">3</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">位小数。</span><span lang="EN-US" style="font-family: 'Times New Roman'"><o:p></o:p></span></font></font></p></p><hr/><h3>样例输入</h3><pre>4
1 1
1 3
9 3
9 1
</pre><hr/><h3>样例输出</h3><pre>2.000</pre><hr/><h3>提示</h3><p><p>1&lt;=N&lt;=100</p></p><hr/><h3>题目来源</h3><p>Day2</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2522" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2522" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>